﻿using System;
using System.ComponentModel;

namespace Loki.Utils
{
    /// <summary>
    /// Common interface for change listeners.
    /// </summary>
    public interface IChangeObserver
    {
        /// <summary>
        /// Tracks the state of the specified object.
        /// </summary>
        /// <param name="P_Observed">The observed object.</param>
        void TrackState(INotifyPropertyChanged P_Observed);

        /// <summary>
        /// Tracks the state of the specified object.
        /// </summary>
        /// <param name="P_Observed">The observed object.</param>
        void TrackState(ICentralizedChangeTracking P_Observed);

        /// <summary>
        /// Gets a value indicating whether any of the observed object has changed.
        /// </summary>
        /// <value>
        ///   <c>true</c> if any of the observed object has changed.; otherwise, <c>false</c>.
        /// </value>
        bool ObservedDirty { get; }

        /// <summary>
        /// Occurs when observed object state changed.
        /// </summary>
        event EventHandler ObservedChanged;
    }
}
